home *** CD-ROM | disk | FTP | other *** search
/ Sound Fx / Sound Fx.iso / Software / UNZIPED / SBPLY254 / SOURCE.ZIP / SB.DOC < prev    next >
Encoding:
Text File  |  1993-11-28  |  1.9 KB  |  43 lines

  1.         Programming the Sound Blaster DSP in DMA Mode
  2.  
  3.         (Note: All values are hexadecimal. This information was obtained
  4.         from the Book "Sound Blaster The Official Book" ISBN 0-07-881907-05)
  5.        
  6.   1.    Set up the ISR
  7.  
  8.   2.    Program the sampling rate to the DSP
  9.          a. Turn on speaker (write D1 to DSP command register 2xC)
  10.          b. Send the Set-Time Constant command (write 40 to 2xC)
  11.          c. Send the time constant (write byte to DSP command register 2xC)
  12.  
  13.   3.    Program the DMA Controller for the first data block
  14.          a. Select DMA channel 1 by writing 5 to DMA mask register 0A
  15.          b. Reset DMA transfer flip/flop (write 00 to DMA clear byte pointer
  16.             register 0C)
  17.          c. Select DMA mode for DAC output (write 45 to DMA mode register 0B)
  18.          d. Send data memory address to DMA controller (write lo byte to 02
  19.             and hi byte to 02)
  20.          e. Send physical memory page number to DMA controller (write to
  21.             page address register 83)
  22.          f. Send DMA data-byte (data length -1) to ch1 transfer count
  23.             register  03 lo then hi
  24.          g. Enable DMA channel 1 (write 01 to mask register 0A)
  25.  
  26.   4.    Program the DSP for the first data block
  27.          a. Send DMA mode 8-bit DAC command (write 14 to DSP command
  28.             register 2xC)
  29.          b. Send the length-1 of data to be transfered (lo, then hi to 2xC)
  30.  
  31.   5.    Service the DSP Interrupt
  32.          a. Save machine status (registers)
  33.          b. Acknowledge DSP interrupt by reading DSP data available status
  34.             register 2xE
  35.          c. If no more blocks to transfere, goto step 5f
  36.          d. Program the DMA controller for next data block (step 3)
  37.          e. Program DSP for next data block (step 4)
  38.          f. Output End-Of-Interrupt to PIC (execute EOI OUT 20,20)
  39.          g. Restore registers.
  40.          h. execute IRET
  41.  
  42.   6.    Restore original ISR
  43.